home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / cross / GBDK-2.0.lha / GBDK / doc / map-frmt.txt < prev    next >
Text File  |  1998-10-01  |  3KB  |  71 lines

  1. From version 2.0b13 the linker map file format has changed.  The
  2. changes were made by Michael Hope to make it more machine readable
  3. so that it could be easially imported into a debugger to give
  4. very elementry source level debugging.
  5.  
  6. File format
  7. -----------
  8. All data is heirachical with the children of a node being indented
  9. from the parent by one tab stop.  This was done to allow a debugger
  10. to easially ignore sections that it didnt recognise.  The top
  11. level nodes currently defined are:
  12.  
  13. AREA     
  14.     contains area information for a code segment including
  15.     its base, size and the values of any global labels
  16.     defined in that area.
  17. MODULES    
  18.     contains a list of modules linked by the linker and their
  19.     names
  20. LIBRARIES 
  21.     contains a list of the libraries linked and the modules
  22.     used from them
  23. USERBASEDEF
  24.     A list of all user base address definitions
  25. USERGLOBALDEF
  26.     A list of all user global variable definitions
  27.  
  28. AREA is the interesting one - the others were kept because the linker
  29. already generates them.
  30.  
  31. As an example is worth PI words, heres an example of an AREA section.
  32. The others are reasonably self explanitory.
  33.  
  34. -- BEGIN example
  35. AREA _CODE
  36.         RADIX HEX
  37.         BASE 0200
  38.         SIZE 3754
  39.         ATTRIB REL CON
  40.         GLOBALS
  41.                 .set_mode       0200
  42.                 .wait_vbl       0236
  43.                 _wait_vbl       0236
  44.                 _enable_interrupts      026F
  45.                 _disable_interrupts     0271
  46.                 _set_interrupts 0273
  47.                 _simple_enum    027E
  48. AREA _DATA
  49.         RADIX HEX
  50.         BASE 3954
  51.         SIZE 00AA
  52.         ATTRIB REL CON
  53.         GLOBALS
  54.                 _digits 39FC
  55. -- END example
  56. This section defines two areas - _CODE which is the standard C code
  57. segment and _DATA which is the standard C data (static variables)
  58. segment.  _CODE runs from 0x0200 to 0x3754 + 0x0200 and was originally
  59. RELocatable.  Quite a few GLOBALS survived through the link process
  60. including _simple_enum which begins at absolute address 0x027E.  Note that
  61. due to the way C exports function labels, this means that the function
  62. simple_enum() begins at 0x027E - so a debugger could set a breakpoint
  63. at 0x027E when asked to break when simple_enum() is called.  This can
  64. also be used to give a call back stack by modifying the CALL <fun>
  65. in an assembler to push the name of the function called, allowing
  66. you to see what function called a routine.
  67.  
  68. Note the tabs between the globals name and the value and that the
  69. list within a section is sorted by value.  In the current implementation
  70. HEX is the only possible RADIX.
  71.